#define admin_header()
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>#(title) - #(dp.getSiteName())</title>
  <link rel="stylesheet" href="#(backStage)/static/layui/css/layui.css">
  <link rel="stylesheet" href="#(backStage)/static/css/style.css">
  <script src="#(backStage)/static/js/jquery-1.8.3.min.js" charset="utf-8"></script>
  <script src="#(backStage)/static/layui/layui.js"></script>
  <script src="#(backStage)/static/toast/toast.js" charset="utf-8"></script>
  <script src="#(backStage)/static/js/validate.js" charset="utf-8"></script>
</head>
<body>
<div class="layui-layout layui-layout-admin">
  <div class="layui-header">
    <div class="layui-logo">
      <div class="site-logo" style="background-image:url(#(dp.getSiteLogo()));"></div>
    </div>
    <!-- 头部区域（可配合layui已有的水平导航） -->
    #if((tab??"").startsWith("setting"))
      #setLocal(isSettingOn = true)
    #end
    #if((tab??"").startsWith("content"))
      #setLocal(isContentOn = true)
    #end
    #if((tab??"").startsWith("user"))
      #setLocal(isUserOn = true)
    #end
    #if((tab??"").startsWith("permission"))
      #setLocal(isPermissionOn = true)
    #end
    #if((tab??"").startsWith("spider"))
    #setLocal(isSpiderOn = true)
    #end

    <ul class="layui-nav layui-layout-left">
      <li class="layui-nav-item #(isSettingOn?'layui-this':'')">
        <a href="#(adminRoot)/setting">系统设置</a>
      </li>
      <li class="layui-nav-item #(isContentOn?'layui-this':'')">
        <a href="#(adminRoot)/content">内容管理</a>
      </li>
      <li class="layui-nav-item #(isUserOn?'layui-this':'')">
        <a href="#(adminRoot)/user/info">个人信息</a>
      </li>
    </ul>
    <ul class="layui-nav layui-layout-right">
      <li class="layui-nav-item">
        <a title="更新缓存中的系统数据" href="javascript:;" onclick="reloadData()">更新缓存</a>
      </li>
      <li class="layui-nav-item">
        <a href="javascript:;">
          <img src="#(user.icon??dp.getSiteLogo())" onerror="this.src='/upload/image/avatar.png'" class="layui-nav-img">
          #(user.nick_name??'已登录')
        </a>
        <dl class="layui-nav-child">
          <dd><a href="#(adminRoot)/user/info">基本信息</a></dd>
          <dd><a href="#(adminRoot)/user/security">安全设置</a></dd>
          <dd><a href="javascript:;" onclick="logout()">离开</a></dd>
        </dl>
      </li>
    </ul>
  </div>

  <div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <ul class="layui-nav layui-nav-tree"  lay-filter="test">
        <li class="layui-nav-item #(tab == "home"?'layui-this':'')">
          <a href="#(adminRoot)/home"><i class="layui-icon">&#xe658;</i>  首页</a>
        </li>
        <li class="layui-nav-item #(isSettingOn ? 'layui-nav-itemed' : '')">
          <a class="" href="javascript:;"><i class="layui-icon">&#xe620;</i>  系统设置</a>
          <dl class="layui-nav-child">
            <dd #(tab=="setting_base"?'class="layui-this"':'')>
              <a href="#(adminRoot)/setting/base">站点设置</a></dd>
            <dd #(tab=="setting_info"?'class="layui-this"':'')>
              <a href="#(adminRoot)/setting/info">站长信息</a></dd>
            <dd #(tab=="setting_seo"?'class="layui-this"':'')>
              <a href="#(adminRoot)/setting/seo">SEO设置</a></dd>
            <dd #(tab=="setting_other"?'class="layui-this"':'')>
              <a href="#(adminRoot)/setting/other">其他设置</a></dd>
            <dd #(tab=="setting_added"?'class="layui-this"':'')>
              <a href="#(adminRoot)/setting/added">扩展数据库字段</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item #(isContentOn ? 'layui-nav-itemed' : '')">
          <a href="javascript:;"><i class="layui-icon">&#xe624;</i>  内容管理</a>
          <dl class="layui-nav-child">
            <dd #(tab=="content_catelog"?'class="layui-this"':'')>
              <a href="#(adminRoot)/content/catelog">分类管理</a></dd>
            <dd #(tab=="content_article"?'class="layui-this"':'')>
              <a href="#(adminRoot)/content/article">文章管理</a></dd>
            <dd #(tab=="content_diary"?'class="layui-this"':'')>
              <a href="#(adminRoot)/content/diary">言语收录</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item #(isUserOn ? 'layui-nav-itemed' : '')">
          <a href="javascript:;"><i class="layui-icon">&#xe60b;</i>  个人信息</a>
          <dl class="layui-nav-child">
            <dd #(tab=="user_info"?'class="layui-this"':'')>
              <a href="#(adminRoot)/user/info">基本信息</a></dd>
            <dd #(tab=="user_security"?'class="layui-this"':'')>
              <a href="#(adminRoot)/user/security">安全设置</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item #(isSpiderOn ? 'layui-nav-itemed' : '')">
          <a href="javascript:;"><i class="layui-icon">&#xe62c;</i>  小说爬取</a>
          <dl class="layui-nav-child">
            <dd #(tab=="spider_task_add"?'class="layui-this"':'')><a href="#(adminRoot)/spider/task/add">添加任务</a></dd>
            <dd #(tab=="spider_task"?'class="layui-this"':'')><a href="#(adminRoot)/spider/task">任务列表</a></dd>
            <dd #(tab=="spider_file_merge"?'class="layui-this"':'')><a href="#(adminRoot)/spider/file/merge">文件合并</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item">
          <a href="javascript:;"><i class="layui-icon">&#xe65f;</i>  其它系统</a>
          <dl class="layui-nav-child">
            <dd><a>搜索引擎</a></dd>
            <dd><a>分词系统</a></dd>
            <dd><a>邮件管理</a></dd>
            <dd><a>消息管理</a></dd>
            <dd><a>授权管理</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item"><a href="">其他内容</a></li>
      </ul>
    </div>
  </div>
<script type="text/javascript">
layui.use(['layer', 'element'], function(){});
/**
 * 退出
 * @return {void}
 */
function logout () {
  ToastLoading('正在退出...');
  $.post("#(adminRoot)/logout")
  .success(function(ret) { ToastShow(ret.code, ret.msg, ret.url); })
  .error(function() { ToastErr('网络错误'); })
}
/**
 * 刷新系统数据缓存
 * @return {void}
 */
function reloadData () {
  ToastLoading('正在更新缓存...');
  $.post("#(adminRoot)/reload/cache")
  .success(function(ret) { ToastShow(ret.code, ret.msg, ret.url); })
  .error(function() { ToastErr('网络错误'); })
}
</script>
#end